#include"ProcessPool.hpp"


void Usage(std::string proc)
{
    // 提示输入进程数量
    std::cout << "Usage:" << proc << "proc_number" << std::endl;
}

void DeBug(std::vector<Channel> Channels)
{
    for(auto a:Channels)
    {
        std::cout<<a.get_name()<<"----"<<a.get_pid()<<std::endl;
    }
}


int main(int argc, char *argv[])
{
    if (argc != 2)
    {
        Usage(argv[0]);
        return UsageError;
    }
    //获取相应的进程和管道数量

    int number=std::stoi(argv[1]);

    std::vector<Channel> Channels;

    
    //默认初始化
    ProcessPool* po=new ProcessPool(number,work); 
    
    //默认15个任务量
    po->Task_sent();

    po->celan_processPool();

    // //初始化进程池
    // InintPool(number,Channels,work);

    // //任务派发
    // Task_sent(Channels);

    // //进程回收
    // celan_processPool(Channels);

    delete po;
    return 0;
}